package com.fuful;

import com.fuful.domain.Product;
import com.fuful.domain.Student;
import com.fuful.domain.Users;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application-context.xml");
        Users myUser = (Users)applicationContext.getBean("myUser2");
        System.out.println(myUser.getUname());
        System.out.println(myUser.getUpwd());
        Product myProduct = (Product)applicationContext.getBean("myProduct");
        System.out.println(myProduct.getPname());
        System.out.println(myProduct.getPtid().getPtname());
        Student myStu = (Student)applicationContext.getBean("myStu");
        System.out.println(myStu.getStuname()+myStu.getGradeClass().getGcname()+myStu.getGradeClass().getGrade().getGname());
    }
}
